<template>
	<view>
		<view id="printReport">
			<slot></slot>
		</view>
		<view class="" style="width: 80px; position: fixed; top: 0; right: 0;" @click="renderScript.headelReport">
			<button type="default">导出</button>
		</view>
	</view>
</template>

<script>
	import {
		base64ToFile,
		savePDF
	} from "@/utils/html2canva-pdf.js"
	export default {
		name: "html2canva-pdf",
		data() {
			return {

			};
		},
		methods: {
			base64ToFile,
			savePDF
		}
	}
</script>


<script module="renderScript" lang="renderjs">
	import html2Canvas from 'html2canvas'
	import JsPDF from 'jspdf'
	import {
		html2canvaPdf
	} from "@/utils/html2canva-pdf.js"
	export default {
		data() {},
		mounted() {},
		methods: {
			headelReport(e, ownerVm) {
				html2canvaPdf(html2Canvas, JsPDF, ownerVm, document.querySelector('#printReport'))
			}
		}
	};
</script>
<style>

</style>